<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of featured
 * 
 * @author Subha Sundar Das (subhasundar.das@gmail.com)
 */
class Listing extends MY_Controller {

    //put your code here


    function listing() {
        parent :: __construct();
        $this->load->model('pickup_model');
        $this->load->model('location_model');
        $this->load->model('member_model');
        $this->load->model('management_model');
        $this->load->model('listing_model');
        $this->load->spark('payments/0.1.6');
    }

    function convert_featured($listing_id=0) {
        $id = intval($this->session->userdata('mem_id'));
        $data['member']['info'] = $this->member_model->get_member($id);
        $data['member']['listing'] = $this->member_model->get_member_listings($id);


        $this->template->title('Welcome', 'carz.com')
                ->set_partial('header', 'header/header')
                ->set_partial('footer', 'footer/footer')
                ->set_partial('customer_care', 'sidebar/customer_care')
                ->set_partial('social_share', 'sidebar/social_share')
                ->set_partial('search_reviews', 'sidebar/search_reviews')
                ->set_partial('recent_news', 'sidebar/recent_news')
                ->set_partial('recent_reviews', 'sidebar/recent_reviews')
                ->build('pages/member/convert_featured', $data);
    }
    
    function make_payment(){
        $memId=$_POST['memID'];
        $gateWay=$_POST['payment'];
        
        $data['member']['info'] = $this->member_model->get_member($memId);
        $data['member']['listing'] = $this->member_model->get_member_listings($memId);
 
        if($gateWay==2)
            $loadPage='authorized_dot_net';
        else
            $loadPage='paypal';

        $this->template->title('Welcome', 'carz.com')
                ->set_partial('header', 'header/header')
                ->set_partial('footer', 'footer/footer')
                ->set_partial('customer_care', 'sidebar/customer_care')
                ->set_partial('social_share', 'sidebar/social_share')
                ->set_partial('search_reviews', 'sidebar/search_reviews')
                ->set_partial('recent_news', 'sidebar/recent_news')
                ->set_partial('recent_reviews', 'sidebar/recent_reviews')
                ->build('pages/member/'.$loadPage, $data);
        
    }
    
    

}

?>
